BigDFT.Interop.MRChemInterop module

This module contains some wrappers for using MRChem to perform calculations.

Input files are defined using the json format as a dictionary.

class MRChemLogfile(logname)[source]

This class stores the detailed output from MRChem.


the energy of the system



property energy

The total energy of the system.

class MRChemCalculator(omp='1', mpi_run='', dry_run=False, skip=False, verbose=True)[source]

A calculator that drives MRChem calculations through the command line.

This calculator will look in the environment for the following variables: * OMP_NUM_THREADS : number of threads to use * MRCHEM_MPIRUN : the mpi command you want to launch mrchem with * MRCHEM_ROOT : the directoy that contains the mrchem executable.

os = <module 'os' from '/usr/local/anaconda/lib/python3.7/'>

Process local run dictionary to create the input directory and identify the command to be passed


dictionary containing the command to be passed to process_run()

Return type



Run the MRChem executable.

post_processing(logname, command)[source]

Post processing the calculation.


a representation of the detailed output.

Return type



The following is an example of module usage:

"""Example of using MRChem interoperability"""
from BigDFT.IO import XYZReader
from BigDFT.Systems import System
from BigDFT.Fragments import Fragment
from os.path import join
from os import getcwd
from copy import deepcopy

# Create a system.
reader = XYZReader("He")
fsys = System()
fsys["FRA:1"] = Fragment(xyzfile=reader)
fsys["FRA:2"] = deepcopy(fsys["FRA:1"])
fsys["FRA:2"].translate([-4, 0, 0])

# Create an input file
inp = {}
inp["WaveFunction"] = {"method": "PBE"}
inp["world_prec"] = 1.0e-2

# Create a Calculator and Run
calc = MRChemCalculator(mpi_run="mpirun -np 1")
log =, input=inp, name="HE2", run_dir="scratch")

# The full set of data from the json output are available